package com.qaml.mes.device.enums;

import java.util.Arrays;

/**
 * @ClassName CheckUpkeepStatusEnum
 * @Description 检保状态
 * @Author leikai
 * @Date 2024/3/5 0005 14:24
 * @Version 1.0
 */
public enum CheckUpkeepStatusEnum {


    NO_COMMIT("no_commit", "未提交"),
    RECHECKING("rechecking", "审核中"),
    TURN_DOWN("turn_down", "已驳回"),
    PASSED("passed", "已通过"),
    ARCHIVIST_TURN_DOWN("archivist_turn_down", "归档驳回"),
    ARCHIVIST("archivist", "已归档"),
    ;


    private String type;

    private String desc;

    CheckUpkeepStatusEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public String getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static CheckUpkeepStatusEnum ofType(String type) {
        if (null == type) {
            return null;
        }
        return Arrays.stream(values()).filter(e -> e.getType().equals(type)).findFirst().orElse(null);
    }
}